package com.rd.student.jike.class2.lihongming.week731_806.Day0731;

import java.util.HashSet;

/**
 * @Auther:Heinrich
 * @Date:2023/7/31-07-31-15:17
 * @Description:c230731.test
 * @version:1.0
 */
public class test01 {
    public static void main(String[] args) {
        HashSet<Integer> set = new HashSet<>();
        while (set.size()<20){
            int a = (int) (Math.random() * 50);
            set.add(a);
        }
        System.out.println(set);

    }
    public static HashSet<Integer> randomNum(int num,int max){
        HashSet<Integer> set = new HashSet<>();
        while (set.size()<num){
            int a = (int) (Math.random() * max);
            set.add(a);
        }
        return set;
    }
}
